<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateLaohaTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('xapps', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name')->unique();
			$table->string('title');
            $table->string('table');
			$table->text('sets')->nullable();
            $table->timestamps();
			$table->softDeletes();
        });

        Schema::create('cates', function (Blueprint $table) {
            $table->increments('id');
			$table->integer('xapp_id');
            $table->integer('parent_id')->default(0);
            $table->integer('order')->default(0);
            $table->string('name');
            $table->string('title');
			$table->string('groups')->nullable();
            $table->timestamps();
        });

    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('xapps');
		Schema::drop('cates');
    }
}
